<?php
/**
 * Extend the RoleManager class to add Zend_Session support
 *
 * @author @@AUTHOR@@
 * @copyright @@AUTHOR@@ @@YEAR@@
 * @version @@VERSION@@
 * @package Extensions
 * @subpackage DbSession
 * @license  @@LICENCE_URL@@ @@LICENCE@@
 *
 * $Id: People.Class.DbSessionRoleManager.php 322 2008-10-11 13:03:00Z dinoboff $
 * $HeadURL: http://vanilla-friends.googlecode.com/svn/trunk/DbSession/library/People/People.Class.DbSessionRoleManager.php $
 */

if (!defined('IN_VANILLA')) exit();

/**
 * @global Context $Context
 */
global $Context;
include_once $Context->Configuration['LIBRARY_PATH'] . '/People/People.Class.RoleManager.php';

/**
 * Force Session data to be reloaded when a category is saved or removed
 * @package Extensions
 * @subpackage DbSession
 */
class DbSessionRoleManager extends RoleManager  {

	function RemoveRole($RemoveRoleID, $ReplacementRoleID) {
		$Success = parent::RemoveRole($RemoveRoleID, $ReplacementRoleID);
		if ($Success) {
			AddConfigurationSetting($this->Context, 'DBSESSION_LAST_UPDATE', mktime());
		}
		return $Success;
	}

	function SaveRole(&$Role) {
		$Success = parent::SaveRole(&$Role);
		if ($Success) {
			AddConfigurationSetting($this->Context, 'DBSESSION_LAST_UPDATE', mktime());
		}
		return $Success;
	}

}
